import Mock from "mockjs";

Mock.mock("/api/user/login", "post", {
  code: 200,
  data: {
    token: "@guid",
    username: "@cname",
    avatar: '@image("200x200")',
    roles: ["admin"],
  },
  message: "登录成功",
});

// 获取用户列表
Mock.mock("/api/user/list", "get", {
  code: 200,
  data: {
    total: 100,
    "list|10": [
      {
        "id|+1": 1,
        name: "@cname",
        email: "@email",
        phone: /^1[3-9]\d{9}$/,
        status: "@pick(['active', 'inactive'])",
        createTime: "@datetime",
        avatar: '@image("100x100")',
        roles: ["@pick(['admin', 'editor', 'user'])"],
      },
    ],
  },
  message: "获取成功",
});
